package com.generator.constant;

import java.util.HashMap;
import java.util.Map;

public class MysqlJdbcTypeParam {



    private static Map<String,String> param = new HashMap<String, String>(){{
        //mysql类型与java类的类型对应 put(mysql类型,jdbcType)
        put("TINYINT","TINYINT");
        put("SMALLINT","SMALLINT");
        put("MEDIUMINT","MEDIUMINT");
        put("INT","Integer");
        put("INTEGER","INTEGER");
        put("BIGINT","BIGINT");
        put("REAL","REAL");
        put("FLOAT","REAL");
        put("DOUBLE","DOUBLE");
        put("DECIMAL","DECIMAL");

        put("CHAR","VARCHAR");
        put("VARCHAR","VARCHAR");
        put("TINYTEXT","VARCHAR");
        put("TEXT","VARCHAR");
        put("MEDIUMTEXT","VARCHAR");
        put("LONGTEXT","VARCHAR");

        put("DATE","TIMESTAMP");
        put("DATETIME","TIMESTAMP");
        put("TIMESTAMP","TIMESTAMP");
    }};

    public static String get(String key){
        return param.get(key.toUpperCase());
    }
}
